package user.notifier;

import java.util.ArrayList;
import java.util.List;

import ids.IDsManager;
import sessionManager.SessionManagerIF;
import user.post.Post;
/**
 * Announcement eh uma classe que cria uma atualização sobre determinado blog
 * @author Igor
 *
 */
public class Announcement {
	
	private SessionManagerIF session ;
	private String idSession;
	private String blogId;
	private String announcementID;
	private List<String> posts;
	/**
	 * Construtor da Classe Announcement
	 * @param idSession - a sessionId de  um usuario
	 * @param blogId - o blogId de um blog
	 */
	public Announcement(String idSession, String blogId){
		this.idSession = idSession;
		this.blogId = blogId;
		this.announcementID = getValidId();
		this.posts = new ArrayList<String>();
	}

	private String getValidId() {
		return IDsManager.getInstance().getAvaibleAnnouncementsId();
	}

	public SessionManagerIF getSession() {
		return session;
	}

	public void setSession(SessionManagerIF session) {
		this.session = session;
	}

	public String getIdSession() {
		return idSession;
	}

	public void setIdSession(String idSession) {
		this.idSession = idSession;
	}

	public String getBlogId() {
		return blogId;
	}

	public void setBlogId(String blogId) {
		this.blogId = blogId;
	}

	public String getAnnouncementID() {
		return announcementID;
	}

	public void setAnnoucementID(String annoucementID) {
		this.announcementID = annoucementID;
	}
	/**
	 * Adiciona um post
	 * @param postId
	 */
	public void addPostAnnoucement(String postId){
		posts.add(postId);
	}

	public List<String> getPosts() {
		return posts;
	}

	public void setPosts(List<String> posts) {
		this.posts = posts;
	}
	
}
